import { request } from "@/utils/request";
import type { DefaultSearchResponse, HotSearchData } from "@/types/search";

// 默认搜索关键词
export const defaultSearch = (): Promise<DefaultSearchResponse> => {
  return request<DefaultSearchResponse>({
    url: "/search/default",
    method: "GET",
  });
};

// 热搜列表(详细)
export const hotSearchDetail = (): Promise<HotSearchData> => {
  return request<HotSearchData>({
    url: "/search/hot/detail",
    method: "GET",
  });
};

// 搜索建议
export const searchSuggest = (keywords: string): Promise<any> => {
  return request<any>({
    url: "/search/suggest",
    method: "GET",
    data: {
      keywords,
      type: "mobile",
    },
  });
};
